# 接口封装时，重点是依据接口文档封装接口信息，需要使用测试数据是从测试用例传递的，接口方法被调用时需要返回对应结果
# 发送请求参数据
# url = "http://kdtx-test.itheima.net/api/login"
# header_data = {
#     "Content-Type": "application/json"
# }
# login_data = {
#     "username": "admin",
#     "password": "HM_2023_test",
#     "code":2,
#     "uuid":"2c801ce9733644218d444503349535b6"
# }
# response = requests.post(url=url,headers=header_data,json=login_data)
#
# #查看响应
# print(response.status_code)
# print(response.json())

import requests
import config

class LoginAPI:
    def __init__(self):
        self.url_verify = config.BASE_URL+"/api/captchaImage"
        self.url_login = config.BASE_URL+"/api/login"

    def get_verify_code(self):
        return requests.get(url=self.url_verify)

    def login(self,test_data):
        return requests.post(url=self.url_login,json=test_data)
